﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace Camc.Duct.Migrations
{
    public partial class adfadada : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_RequestBase_LineInstances_LineInstanceId",
                table: "RequestBase");

            migrationBuilder.DropPrimaryKey(
                name: "PK_RequestBase",
                table: "RequestBase");

            migrationBuilder.RenameTable(
                name: "RequestBase",
                newName: "RequestBases");

            migrationBuilder.RenameIndex(
                name: "IX_RequestBase_LineInstanceId",
                table: "RequestBases",
                newName: "IX_RequestBases_LineInstanceId");

            migrationBuilder.AddPrimaryKey(
                name: "PK_RequestBases",
                table: "RequestBases",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_RequestBases_LineInstances_LineInstanceId",
                table: "RequestBases",
                column: "LineInstanceId",
                principalTable: "LineInstances",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_RequestBases_LineInstances_LineInstanceId",
                table: "RequestBases");

            migrationBuilder.DropPrimaryKey(
                name: "PK_RequestBases",
                table: "RequestBases");

            migrationBuilder.RenameTable(
                name: "RequestBases",
                newName: "RequestBase");

            migrationBuilder.RenameIndex(
                name: "IX_RequestBases_LineInstanceId",
                table: "RequestBase",
                newName: "IX_RequestBase_LineInstanceId");

            migrationBuilder.AddPrimaryKey(
                name: "PK_RequestBase",
                table: "RequestBase",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_RequestBase_LineInstances_LineInstanceId",
                table: "RequestBase",
                column: "LineInstanceId",
                principalTable: "LineInstances",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
